// pages/login1/login1.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: null
  },
  //第一步
  Login(e) {
    let that = this;
    wx.getUserProfile({
      desc: 'desc',
      success(res) {
        //第二步
        wx.login({
          success(res1) {
            //  console.log(res)
            wx.request({
              url: 'http://dil.aynakedu.com/api/Loginpage',
              data: {
                code: res1.code,
                userInfo: res.userInfo
              },
              //第三步
              method: "POST",
              success(res2) {
                // console.log(res2);
                that.setData({
                  userInfo: res2.data.userInfo,
                });

              }
            });
          }
        });
      }
    });
  }






})